Add icon on input and output, bump name to 20 chars.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 21 Jan 2003 14:35:12 +0000 (14:35 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 21 Jan 2003 14:35:12 +0000 (14:35 +0000)
gpsbabel/gpsdrive.c

index 497bb52d9d0f817ee7341e362d274cc0ac48ef74..64cb3a218edc4bd1612a1c91f3f44503e0da36fa 100644 (file)
@@ -105,7 +105,10 @@ data_read(void)
                                break;
                        case 2:
                                wpt_tmp->position.longitude.degrees = atof(s);
-                       break;
+                               break;
+                       case 3:
+                               wpt_tmp->icon_descr = xstrdup(s);
+                               break;
                        default:
                            fprintf (stderr, "%s: Warning: unmapped data fields on line %d.\n", 
                                MYNAME, linecount);
@@ -159,10 +162,16 @@ gpsdrive_waypt_pr(const waypoint *wpt)
                        shortname = mkshort(mkshort_wr_handle, shortname);
        }
 
-       fprintf(file_out, "%s %08.5f %08.5f\n",
+       fprintf(file_out, "%s %08.5f %08.5f",
                shortname,
                lat,
                lon);
+       if (wpt->icon_descr) {
+               char *s = csv_stringclean(wpt->icon_descr, " ");
+               fprintf(file_out, " %s", s);
+               free(s);
+       }
+       fprintf(file_out, "\n");
                
        if (shortname)
                free (shortname);
@@ -173,7 +182,7 @@ static void
 data_write(void)
 {
        mkshort_wr_handle = mkshort_new_handle();
-       setshort_length(mkshort_wr_handle, 10);
+       setshort_length(mkshort_wr_handle, 20);
        setshort_whitespace_ok(mkshort_wr_handle, 0);
 
        waypt_disp_all(gpsdrive_waypt_pr);